package com.yl.danmo.service.impl;


import com.yl.common.core.utils.DateUtils;
import com.yl.danmo.domain.DanmoPersonPosition;
import com.yl.danmo.mapper.DanmoPersonPositionMapper;
import com.yl.danmo.service.IDanmoPersonPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员职位关联Service业务层处理
 * 
 * @author yl
 * @date 2025-04-12
 */
@Service
public class DanmoPersonPositionServiceImpl implements IDanmoPersonPositionService
{
    @Autowired
    private DanmoPersonPositionMapper danmoPersonPositionMapper;

    /**
     * 查询会员职位关联
     * 
     * @param id 会员职位关联主键
     * @return 会员职位关联
     */
    @Override
    public DanmoPersonPosition selectDanmoPersonPositionById(Long id)
    {
        return danmoPersonPositionMapper.selectDanmoPersonPositionById(id);
    }

    /**
     * 查询会员职位关联列表
     * 
     * @param danmoPersonPosition 会员职位关联
     * @return 会员职位关联
     */
    @Override
    public List<DanmoPersonPosition> selectDanmoPersonPositionList(DanmoPersonPosition danmoPersonPosition)
    {
        return danmoPersonPositionMapper.selectDanmoPersonPositionList(danmoPersonPosition);
    }

    /**
     * 新增会员职位关联
     * 
     * @param danmoPersonPosition 会员职位关联
     * @return 结果
     */
    @Override
    public int insertDanmoPersonPosition(DanmoPersonPosition danmoPersonPosition)
    {
        danmoPersonPosition.setCreateTime(DateUtils.getNowDate());
        return danmoPersonPositionMapper.insertDanmoPersonPosition(danmoPersonPosition);
    }

    /**
     * 修改会员职位关联
     * 
     * @param danmoPersonPosition 会员职位关联
     * @return 结果
     */
    @Override
    public int updateDanmoPersonPosition(DanmoPersonPosition danmoPersonPosition)
    {
        danmoPersonPosition.setUpdateTime(DateUtils.getNowDate());
        return danmoPersonPositionMapper.updateDanmoPersonPosition(danmoPersonPosition);
    }

    /**
     * 批量删除会员职位关联
     * 
     * @param ids 需要删除的会员职位关联主键
     * @return 结果
     */
    @Override
    public int deleteDanmoPersonPositionByIds(Long[] ids)
    {
        return danmoPersonPositionMapper.deleteDanmoPersonPositionByIds(ids);
    }

    /**
     * 删除会员职位关联信息
     * 
     * @param id 会员职位关联主键
     * @return 结果
     */
    @Override
    public int deleteDanmoPersonPositionById(Long id)
    {
        return danmoPersonPositionMapper.deleteDanmoPersonPositionById(id);
    }
}
